package lz.controls.nick
{
	import com.common.utils.Debug;
	import com.global.GlobalDef;
	
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormat;
	
	public class TweenTextField extends Sprite
	{
		/**
		 *文本内容  
		 */
		private var _text:TextField;
		public function TweenTextField()
		{
			super();
			init();
		}
		private function init():void
		{
			_text = new TextField();
			_text.text = "football";
			var tf:TextFormat = new TextFormat();
			tf.color = 0xFFFF00;
			tf.size = 16;
			tf.align = TextFieldAutoSize.CENTER;
			tf.bold = true;
			_text.width = 250;
			_text.height = 40;
			
			_text.defaultTextFormat = tf;
			this.addChild(_text);
			
		}
		public function set text($str:String):void
		{
			if($str == null || $str == "")
			{
				Debug.echo("提示信息错误");
				return;
			}
			_text.text = $str;
			this.alpha = 0;
			this.x = (GlobalDef.GameWidth - this.width)>>1;
			this.y = 200;
			GlobalDef.GameContainer.addChild(this);
		}
	}
}